<template>
    <div>
        <button @click="changeNum(1)">increment</button>
        <button @click="changeNum(-1)">decrement</button>
    </div>
</template>

<script>
export default {
  emits:['onIncrement'],
    setup(props,context){
     const changeNum=(num)=>{
      context.emit('onIncrement',num)
     }
     return {changeNum}
    }
};
</script>